
# these packages are required
library(survey)
library(foreign)
library(doBy)
library(xtable)
library(ggplot2)

# create a log file. replication archive includes a sample.
con <- file("log.txt")
sink(con, append=TRUE)
sink(con, append=TRUE, type="message")

# run code for each survey-year to produce graphs and figures
source("descriptive_analysis_2008_ccap.R", max.deparse.length=100000, echo=TRUE)
source("descriptive_analysis_2008_cces_cong.R", max.deparse.length=100000, echo=TRUE)
source("descriptive_analysis_2010.R", max.deparse.length=100000, echo=TRUE)
source("descriptive_analysis_2012_pres.R", max.deparse.length=100000, echo=TRUE)
source("descriptive_analysis_2012_cong.R", max.deparse.length=100000, echo=TRUE)
source("descriptive_analysis_2014.R", max.deparse.length=100000, echo=TRUE)

# restore output to console
sink() 
sink(type="message")
